<!--#include file="pjson.asp"-->
<%
	Easp.NoCache
	vas "username",session("username")

if val("type")="byjx" then
    vas "type","本院外出进修"
else
    vas "type","外院进修"
end if 
  s1 "select * from jxdj where [ID]={id}"
%>
    <!DOCTYPE html>
    <html>

    <head>
        <%easp.include "h.asp"%>
            <style>
                #sub {
                    padding-left: 30px;
                }
                
                .layui-fluid {
                    left: 200px;
                }
            </style>
    </head>

    <body>
        <%blockquote(val("type"))%>
            <div class="layui-form" lay-filter="layuiadmin-form-useradmin" id="layuiadmin-form-useradmin" style="padding: 20px 0 0 0;">
                <%'t_define "jxdj"
	Echo input1("bh","编号","required|number")
	Echo input1("xm","姓名","1")

hi "id",val("id")

hi "type",val("type")

sql="select name3 from b where value1={bh}"
s1 sql
vas "i_sfz_d", val("name3")
hi "i_sfz_d",val("i_sfz_d")
Echo button1("sfz","身份证",val("i_sfz_d"))

if val("type")="byjx" then
elseif val("type")="wyjx" then
else
end if

%>
                    <div class="layui-form-item">
                        <label class="layui-form-label">给接单人</label>
                        <%  cb "in_out","是否","checked"%>
                    </div>

                    <br>
                    <input type="hidden" name="id" value="<%=val("id")%>">
                    <div class="layui-form-item" id="sub">
                        <!-- layui-hide-->
                        <input class="layui-btn layui-btn-lg" type="button" lay-submit lay-filter="LAY-user-front-submit" id="LAY-user-front-submit" value="确认">
                    </div>
            </div>

            <script src="/dzps/src/layuiadmin/layui/layui.js"></script>
            <script>
                layui.config({
                    base: '/dzps/src/layuiadmin/'
                }).extend({
                    index: 'lib/index' //主入口模块
                }).use(['index', 'set', 'form', 'upload', 'laydate'], function() {
                    var $ = layui.$,
                        admin = layui.admin,
                        form = layui.form,
                        laydate = layui.laydate,
                        upload = layui.upload;
$("#bh").keyup(function(){
  console.log($("#bh").val());

				$.post('pjson.asp?now=' + new Date().getTime(), {
					action: "bh_exist",
					bh: $("#bh").val()
				},
				function(data) {
					if(data=="1"){
                        layer.msg("编号重复！！");
                    }

				});
});
                    //下载模板
                    function downLoad(fn) {
                        var curWwwPath = window.document.location.href;
                        var pathName = window.document.location.pathname;
                        var pos = curWwwPath.indexOf(pathName);
                        var localhostPath = curWwwPath.substring(0, pos);
                        var projectName = pathName.substring(0, pathName.substr(1).indexOf('/') + 1);
                        var url = localhostPath + projectName + "/upload/" + fn;
                        window.open(url);
                    }
                    $("#sfz_d").click(function() {
                        downLoad($("#i_sfz_d").val());
                    });


                    laydate.render({
                        elem: '#jxkssj'
                    });
                    laydate.render({
                        elem: '#jxjssj'
                    });
                    upload.render({
                        elem: '#sfz_u',
                        url: location.protocol + '//' + location.host + '/dzps/upf.asp?tn=<%=val("tn")%>&fName=<%=val("i_sfz_d")%>&now=' + new Date().getTime(),
                        accept: 'file',
                        exts: 'zip|rar|7z|pdf|qes|doc|docx|bmp|jpg',
                        done: function(res) {
                            console.log(res);
                            layer.msg('上传成功！！');
                            $("#i_sfz_d").val(res.msg);
                            $("#sfz").val(res.msg);
                        }
                    });

                    form.on('submit(LAY-user-front-submit)', function(data) {
                        var field = data.field;
                        $('#bh').keyup();
                        admin.req({
                            url: 'pjson.asp?now=' + new Date().getTime()+"&action=jxdj_add",
                            data: field,
                            done: function(res) {
                                if (res.msg == '成功') {
                                    layer.msg(res.msg, {
                                        offset: '15px',
                                        icon: 1,
                                        time: 1000
                                    }, function() {});
                                } else {
                                    layer.msg(res.msg, {
                                        offset: '15px',
                                        icon: 1,
                                        time: 1000
                                    }, function() {});
                                }
                            }
                        });
                    });
                });
            </script>
    </body>

    </html>